<template>
  <el-config-provider :locale="zhCn">
    <div class="app">
      <!-- 菜单栏 -->
      <menu-bar />
      <main
        v-loading="loadingStateStroe.loading"
        class="main"
        :element-loading-text="loadingStateStroe.loadingText"
      >
        <nav-bar />
        <div class="router">
          <router-view v-slot="{ Component }">
            <keep-alive>
              <component :is="Component" />
            </keep-alive>
          </router-view>
        </div>
      </main>
    </div>
  </el-config-provider>
</template>

<script setup lang="ts">
import MenuBar from './components/MenuBar/index.vue'
import NavBar from './components/NavBar/index.vue'
import useGlobalLoadingStateStroe from './store/Loading/GlobalLoadingStateStroe'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

const loadingStateStroe = useGlobalLoadingStateStroe()
</script>

<style lang="less" scoped>
.app {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background: #fdfdfd;

  .main {
    flex: 1;
    display: flex;

    .router {
      flex: 1;
    }
  }
}
</style>
